<!-- 表格内容,此组件还用于生成导出文件,所以不应该依赖vue组件相关的上下文 -->
<script lang="ts" setup>
import {
	CREDIT_INFO_REPORT_TYPE_OPTIONS,
	DANGER_SOURCE_LEVEL_OPTIONS,
	getEnumOptionsField,
} from "@/config/enum-options";

defineOptions({ name: "SheetItem" });
</script>

<template>
	<el-table-column label="序号" width="60" type="index" fixed="left" />
	<el-table-column label="报告编号" prop="reportCode" />
	<el-table-column v-slot="{ row }" label="报告类型" prop="reportType">
		<span
			:style="{
				color: getEnumOptionsField(
					CREDIT_INFO_REPORT_TYPE_OPTIONS,
					'color',
					row.reportType,
				),
			}"
		>
			{{
				getEnumOptionsField(
					CREDIT_INFO_REPORT_TYPE_OPTIONS,
					"label",
					row.reportType,
				)
			}}
		</span>
	</el-table-column>
	<el-table-column label="评估项目名称" prop="projectName" />

	<!-- TODO 接口缺少 -->
	<el-table-column label="评估单位" prop="evaluateUnit" />
	<el-table-column label="评估时间" prop="evaluateTime" />
	<el-table-column v-slot="{ row }" label="重大危险源等级" prop="dangerLevel">
		<span
			:style="{
				color: getEnumOptionsField(
					DANGER_SOURCE_LEVEL_OPTIONS,
					'color',
					row.dangerLevel,
				),
			}"
		>
			{{
				getEnumOptionsField(
					DANGER_SOURCE_LEVEL_OPTIONS,
					"label",
					row.dangerLevel,
				)
			}}
		</span>
	</el-table-column>
</template>
